﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

namespace Torch_Entity.Torch_SqlEntity
{
    public partial class SmartSchoolDbContext : DbContext
    {
        public SmartSchoolDbContext()
        {
        }

        public SmartSchoolDbContext(DbContextOptions<SmartSchoolDbContext> options)
            : base(options)
        {
        }

        public virtual DbSet<Address> Addresses { get; set; } = null!;
        public virtual DbSet<Addressinformation> Addressinformations { get; set; } = null!;
        public virtual DbSet<Announcement> Announcements { get; set; } = null!;
        public virtual DbSet<Announcementtype> Announcementtypes { get; set; } = null!;
        public virtual DbSet<Attendance> Attendances { get; set; } = null!;
        public virtual DbSet<Attendancepermission> Attendancepermissions { get; set; } = null!;
        public virtual DbSet<Bannerphoto> Bannerphotos { get; set; } = null!;
        public virtual DbSet<Bookapplybookinfo> Bookapplybookinfos { get; set; } = null!;
        public virtual DbSet<Bookinfo> Bookinfos { get; set; } = null!;
        public virtual DbSet<Bookorder> Bookorders { get; set; } = null!;
        public virtual DbSet<Bookrepository> Bookrepositories { get; set; } = null!;
        public virtual DbSet<Bookscategory> Bookscategories { get; set; } = null!;
        public virtual DbSet<Boothinfo> Boothinfos { get; set; } = null!;
        public virtual DbSet<Borrow> Borrows { get; set; } = null!;
        public virtual DbSet<Borrowbook> Borrowbooks { get; set; } = null!;
        public virtual DbSet<Checkdormitory> Checkdormitories { get; set; } = null!;
        public virtual DbSet<Class> Classes { get; set; } = null!;
        public virtual DbSet<Copyright> Copyrights { get; set; } = null!;
        public virtual DbSet<Coursepermission> Coursepermissions { get; set; } = null!;
        public virtual DbSet<Credittype> Credittypes { get; set; } = null!;
        public virtual DbSet<Credittyperecord> Credittyperecords { get; set; } = null!;
        public virtual DbSet<Desert> Deserts { get; set; } = null!;
        public virtual DbSet<Desertpermission> Desertpermissions { get; set; } = null!;
        public virtual DbSet<DormitoryFee> DormitoryFees { get; set; } = null!;
        public virtual DbSet<Dormitoryelectricitycount> Dormitoryelectricitycounts { get; set; } = null!;
        public virtual DbSet<Dormitoryfeestandard> Dormitoryfeestandards { get; set; } = null!;
        public virtual DbSet<Dormitorypermission> Dormitorypermissions { get; set; } = null!;
        public virtual DbSet<Exampaperinformation> Exampaperinformations { get; set; } = null!;
        public virtual DbSet<Fastmenu> Fastmenus { get; set; } = null!;
        public virtual DbSet<Friendlylink> Friendlylinks { get; set; } = null!;
        public virtual DbSet<Function> Functions { get; set; } = null!;
        public virtual DbSet<Grade> Grades { get; set; } = null!;
        public virtual DbSet<Gradepermission> Gradepermissions { get; set; } = null!;
        public virtual DbSet<InOutinfo> InOutinfos { get; set; } = null!;
        public virtual DbSet<InOutpersoninfo> InOutpersoninfos { get; set; } = null!;
        public virtual DbSet<Job> Jobs { get; set; } = null!;
        public virtual DbSet<Jobpermission> Jobpermissions { get; set; } = null!;
        public virtual DbSet<Meetingrecord> Meetingrecords { get; set; } = null!;
        public virtual DbSet<Meetingresult> Meetingresults { get; set; } = null!;
        public virtual DbSet<Meetingtype> Meetingtypes { get; set; } = null!;
        public virtual DbSet<Mentorevaluate> Mentorevaluates { get; set; } = null!;
        public virtual DbSet<News> News { get; set; } = null!;
        public virtual DbSet<Newscategory> Newscategories { get; set; } = null!;
        public virtual DbSet<Outsourcing> Outsourcings { get; set; } = null!;
        public virtual DbSet<Overduecostmanagement> Overduecostmanagements { get; set; } = null!;
        public virtual DbSet<Overduecoststandard> Overduecoststandards { get; set; } = null!;
        public virtual DbSet<Postponetime> Postponetimes { get; set; } = null!;
        public virtual DbSet<Questioninformation> Questioninformations { get; set; } = null!;
        public virtual DbSet<Reply> Replies { get; set; } = null!;
        public virtual DbSet<Reportinfo> Reportinfos { get; set; } = null!;
        public virtual DbSet<Role> Roles { get; set; } = null!;
        public virtual DbSet<Salary> Salaries { get; set; } = null!;
        public virtual DbSet<SchoolIncome> SchoolIncomes { get; set; } = null!;
        public virtual DbSet<Schoolspending> Schoolspendings { get; set; } = null!;
        public virtual DbSet<Staffsalary> Staffsalaries { get; set; } = null!;
        public virtual DbSet<Stuachievement> Stuachievements { get; set; } = null!;
        public virtual DbSet<Studentevaluate> Studentevaluates { get; set; } = null!;
        public virtual DbSet<Studentexaminformation> Studentexaminformations { get; set; } = null!;
        public virtual DbSet<Studentspermission> Studentspermissions { get; set; } = null!;
        public virtual DbSet<Studisciplinary> Studisciplinaries { get; set; } = null!;
        public virtual DbSet<Stuparentspermission> Stuparentspermissions { get; set; } = null!;
        public virtual DbSet<Subject> Subjects { get; set; } = null!;
        public virtual DbSet<Subjectpermission> Subjectpermissions { get; set; } = null!;
        public virtual DbSet<Teachpermission> Teachpermissions { get; set; } = null!;
        public virtual DbSet<Tuition> Tuitions { get; set; } = null!;
        public virtual DbSet<Tuitionpermission> Tuitionpermissions { get; set; } = null!;
        public virtual DbSet<User> Users { get; set; } = null!;
        public virtual DbSet<Usersinfo> Usersinfos { get; set; } = null!;
        public virtual DbSet<Warranty> Warranties { get; set; } = null!;
        public virtual DbSet<Warrantymoney> Warrantymoneys { get; set; } = null!;
        public virtual DbSet<Webmenu> Webmenus { get; set; } = null!;

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseMySql("server=localhost;database=smartschooldb;user id=root;password=Admin123", Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.10-mysql"));
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseCollation("utf8_general_ci")
                .HasCharSet("utf8");

            modelBuilder.Entity<Address>(entity =>
            {
                entity.ToTable("address");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.ParentId).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Addressinformation>(entity =>
            {
                entity.ToTable("addressinformation");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.ContainsPerson).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Announcement>(entity =>
            {
                entity.ToTable("announcement");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.AnnouncementType).HasColumnType("int(11)");

                entity.Property(e => e.EndTime).HasColumnType("datetime");

                entity.Property(e => e.NoticeInfo).HasMaxLength(200);

                entity.Property(e => e.StartTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Announcementtype>(entity =>
            {
                entity.ToTable("announcementtype");

                entity.HasIndex(e => e.AnnouncementType1, "AnnouncementType")
                    .IsUnique();

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.AnnouncementType1)
                    .HasMaxLength(50)
                    .HasColumnName("AnnouncementType");
            });

            modelBuilder.Entity<Attendance>(entity =>
            {
                entity.ToTable("attendance");

                entity.HasIndex(e => e.Title, "Title")
                    .IsUnique();

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Attendancepermission>(entity =>
            {
                entity.ToTable("attendancepermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.AttendanceDate)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.AttendanceId).HasColumnType("int(11)");

                entity.Property(e => e.AttendancePersonId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Bannerphoto>(entity =>
            {
                entity.ToTable("bannerphoto");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.PhotoPath).HasMaxLength(255);
            });

            modelBuilder.Entity<Bookapplybookinfo>(entity =>
            {
                entity.ToTable("bookapplybookinfo");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.BuyNumber).HasColumnType("int(11)");

                entity.Property(e => e.Category).HasColumnType("int(11)");

                entity.Property(e => e.Info).HasMaxLength(500);

                entity.Property(e => e.Photo).HasMaxLength(500);

                entity.Property(e => e.Price).HasPrecision(6, 2);

                entity.Property(e => e.PublishingHouse).HasMaxLength(500);

                entity.Property(e => e.State).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(100);
            });

            modelBuilder.Entity<Bookinfo>(entity =>
            {
                entity.ToTable("bookinfo");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.BooksCategoryId).HasColumnType("int(11)");

                entity.Property(e => e.BooksDescription).HasMaxLength(500);

                entity.Property(e => e.BooksName).HasMaxLength(50);

                entity.Property(e => e.BooksPhoto).HasMaxLength(500);

                entity.Property(e => e.BooksPrice).HasPrecision(6, 2);

                entity.Property(e => e.PublishingHouse).HasMaxLength(500);

                entity.Property(e => e.StartTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Bookorder>(entity =>
            {
                entity.ToTable("bookorder");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.InfoId).HasColumnType("int(11)");

                entity.Property(e => e.Number).HasColumnType("int(11)");

                entity.Property(e => e.Price).HasPrecision(6, 2);

                entity.Property(e => e.Time)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Bookrepository>(entity =>
            {
                entity.ToTable("bookrepository");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.BookInfo).HasColumnType("int(11)");

                entity.Property(e => e.BookSum).HasColumnType("int(11)");

                entity.Property(e => e.InRepositoryTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Bookscategory>(entity =>
            {
                entity.ToTable("bookscategory");

                entity.HasIndex(e => e.BooksType, "BooksType")
                    .IsUnique();

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.BooksType).HasMaxLength(50);

                entity.Property(e => e.ParentId)
                    .HasColumnType("int(11)")
                    .HasColumnName("parentId");
            });

            modelBuilder.Entity<Boothinfo>(entity =>
            {
                entity.ToTable("boothinfo");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Address).HasColumnType("int(11)");

                entity.Property(e => e.BoothPrice).HasPrecision(8, 2);

                entity.Property(e => e.BoothTime).HasColumnType("int(11)");

                entity.Property(e => e.Contracted).HasColumnType("int(11)");

                entity.Property(e => e.StartTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Borrow>(entity =>
            {
                entity.ToTable("borrow");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.BorrowDate).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Borrowbook>(entity =>
            {
                entity.ToTable("borrowbooks");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.BooksInfoId).HasColumnType("int(11)");

                entity.Property(e => e.BorrowPerson).HasColumnType("int(11)");

                entity.Property(e => e.BorrowStandardId).HasColumnType("int(11)");

                entity.Property(e => e.BorrowState).HasColumnType("int(11)");

                entity.Property(e => e.InRepositoryTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.PostponeApplyRecord).HasColumnType("int(11)");

                entity.Property(e => e.PostponeTime).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Checkdormitory>(entity =>
            {
                entity.ToTable("checkdormitory");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.ArrivePerson).HasColumnType("int(11)");

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("createTime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.Description).HasColumnType("text");

                entity.Property(e => e.DormitoryId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Class>(entity =>
            {
                entity.ToTable("class");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Grade).HasColumnType("int(11)");

                entity.Property(e => e.SubjectId).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Copyright>(entity =>
            {
                entity.ToTable("copyright");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Address).HasMaxLength(255);

                entity.Property(e => e.Content).HasColumnType("text");

                entity.Property(e => e.Email).HasMaxLength(50);

                entity.Property(e => e.Fax).HasMaxLength(50);

                entity.Property(e => e.Images).HasMaxLength(255);

                entity.Property(e => e.Logo).HasMaxLength(255);

                entity.Property(e => e.Phone).HasMaxLength(50);

                entity.Property(e => e.Qq)
                    .HasMaxLength(50)
                    .HasColumnName("QQ");

                entity.Property(e => e.Telephone).HasMaxLength(50);

                entity.Property(e => e.Title).HasMaxLength(50);

                entity.Property(e => e.WeChat).HasMaxLength(50);
            });

            modelBuilder.Entity<Coursepermission>(entity =>
            {
                entity.ToTable("coursepermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.AddressId).HasColumnType("int(11)");

                entity.Property(e => e.EndTime).HasColumnType("datetime");

                entity.Property(e => e.StaffId).HasColumnType("int(11)");

                entity.Property(e => e.StartTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Credittype>(entity =>
            {
                entity.ToTable("credittype");

                entity.HasIndex(e => e.Type, "type")
                    .IsUnique();

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Score).HasColumnType("int(11)");

                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .HasColumnName("type");
            });

            modelBuilder.Entity<Credittyperecord>(entity =>
            {
                entity.ToTable("credittyperecord");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.AddPerson).HasColumnType("int(11)");

                entity.Property(e => e.AddReason).HasMaxLength(100);

                entity.Property(e => e.CreditType).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Desert>(entity =>
            {
                entity.ToTable("desert");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Description).HasMaxLength(100);

                entity.Property(e => e.DesertPrice).HasPrecision(6, 2);
            });

            modelBuilder.Entity<Desertpermission>(entity =>
            {
                entity.ToTable("desertpermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.DesertId).HasMaxLength(100);

                entity.Property(e => e.StaffId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<DormitoryFee>(entity =>
            {
                entity.ToTable("dormitory_fee");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Fee).HasColumnType("int(11)");

                entity.Property(e => e.FeePerson).HasColumnType("int(11)");

                entity.Property(e => e.FeeTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Dormitoryelectricitycount>(entity =>
            {
                entity.ToTable("dormitoryelectricitycount");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("createTime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.DormitoryId).HasColumnType("int(11)");

                entity.Property(e => e.Electricity).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Dormitoryfeestandard>(entity =>
            {
                entity.ToTable("dormitoryfeestandard");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.FeeMoney).HasPrecision(8, 2);
            });

            modelBuilder.Entity<Dormitorypermission>(entity =>
            {
                entity.ToTable("dormitorypermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.DormitoryId).HasColumnType("int(11)");

                entity.Property(e => e.PersonInformation).HasMaxLength(20);
            });

            modelBuilder.Entity<Exampaperinformation>(entity =>
            {
                entity.ToTable("exampaperinformation");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.ExamDifficulty).HasColumnType("int(11)");

                entity.Property(e => e.ExamGrade).HasColumnType("int(11)");

                entity.Property(e => e.QuestionInfo).HasMaxLength(100);

                entity.Property(e => e.QuestionPersonSend).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Fastmenu>(entity =>
            {
                entity.ToTable("fastmenu");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Link).HasMaxLength(255);

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Friendlylink>(entity =>
            {
                entity.ToTable("friendlylink");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Link).HasMaxLength(255);

                entity.Property(e => e.Photo).HasMaxLength(255);

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Function>(entity =>
            {
                entity.ToTable("function");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Image).HasMaxLength(500);

                entity.Property(e => e.Link).HasMaxLength(255);

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Grade>(entity =>
            {
                entity.ToTable("grade");

                entity.HasIndex(e => e.GradeDate, "GradeDate")
                    .IsUnique();

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.GradeDate).HasColumnType("datetime");
            });

            modelBuilder.Entity<Gradepermission>(entity =>
            {
                entity.ToTable("gradepermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.AddressId).HasColumnType("int(11)");

                entity.Property(e => e.EndTime).HasColumnType("datetime");

                entity.Property(e => e.GradeId).HasColumnType("int(11)");

                entity.Property(e => e.StartTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<InOutinfo>(entity =>
            {
                entity.ToTable("in_outinfo");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.InOutPerson).HasColumnType("int(11)");

                entity.Property(e => e.InOutState).HasColumnType("int(11)");

                entity.Property(e => e.InOutTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<InOutpersoninfo>(entity =>
            {
                entity.ToTable("in_outpersoninfo");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Address).HasMaxLength(255);

                entity.Property(e => e.Gender).HasColumnType("int(11)");

                entity.Property(e => e.RealName).HasMaxLength(20);

                entity.Property(e => e.Tel).HasMaxLength(50);
            });

            modelBuilder.Entity<Job>(entity =>
            {
                entity.ToTable("jobs");

                entity.HasIndex(e => e.Title, "Title")
                    .IsUnique();

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(20);
            });

            modelBuilder.Entity<Jobpermission>(entity =>
            {
                entity.ToTable("jobpermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.JobsId).HasMaxLength(100);

                entity.Property(e => e.StaffId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Meetingrecord>(entity =>
            {
                entity.ToTable("meetingrecord");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.JoinPerson).HasMaxLength(50);

                entity.Property(e => e.MeetingNoticeInfo).HasMaxLength(200);

                entity.Property(e => e.MeetingTypeId).HasColumnType("int(11)");

                entity.Property(e => e.StartTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.WarnTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<Meetingresult>(entity =>
            {
                entity.ToTable("meetingresult");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.EndTime).HasColumnType("datetime");

                entity.Property(e => e.MeetingInfo).HasMaxLength(200);

                entity.Property(e => e.MeetingPerson).HasMaxLength(50);

                entity.Property(e => e.MeetingRecord).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Meetingtype>(entity =>
            {
                entity.ToTable("meetingtype");

                entity.HasIndex(e => e.MeetingType1, "MeetingType")
                    .IsUnique();

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.MeetingType1)
                    .HasMaxLength(50)
                    .HasColumnName("MeetingType");
            });

            modelBuilder.Entity<Mentorevaluate>(entity =>
            {
                entity.ToTable("mentorevaluate");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.EvaluateInfo).HasMaxLength(100);

                entity.Property(e => e.EvaluateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.StaffId).HasColumnType("int(11)");

                entity.Property(e => e.StudentId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<News>(entity =>
            {
                entity.ToTable("news");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Browse)
                    .HasColumnType("int(11)")
                    .HasDefaultValueSql("'0'");

                entity.Property(e => e.Info).HasColumnType("text");

                entity.Property(e => e.PublishingTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.SourceDescription).HasColumnType("text");

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Newscategory>(entity =>
            {
                entity.ToTable("newscategory");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            modelBuilder.Entity<Outsourcing>(entity =>
            {
                entity.ToTable("outsourcing");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Address).HasMaxLength(255);

                entity.Property(e => e.Email).HasMaxLength(100);

                entity.Property(e => e.Gender).HasColumnType("int(11)");

                entity.Property(e => e.IdentityCard).HasMaxLength(100);

                entity.Property(e => e.Phone).HasMaxLength(100);

                entity.Property(e => e.RealName).HasMaxLength(10);
            });

            modelBuilder.Entity<Overduecostmanagement>(entity =>
            {
                entity.ToTable("overduecostmanagement");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.OverduePersonId).HasColumnType("int(11)");

                entity.Property(e => e.OverdueStandardId).HasColumnType("int(11)");

                entity.Property(e => e.OverdueTime).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Overduecoststandard>(entity =>
            {
                entity.ToTable("overduecoststandard");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.OverdueCost).HasPrecision(6, 2);
            });

            modelBuilder.Entity<Postponetime>(entity =>
            {
                entity.ToTable("postponetime");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.PostponeTime1)
                    .HasColumnType("int(11)")
                    .HasColumnName("PostponeTime");
            });

            modelBuilder.Entity<Questioninformation>(entity =>
            {
                entity.ToTable("questioninformation");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.Aoption)
                    .HasMaxLength(200)
                    .HasColumnName("AOption");

                entity.Property(e => e.Boption)
                    .HasMaxLength(200)
                    .HasColumnName("BOption");

                entity.Property(e => e.Coption)
                    .HasMaxLength(200)
                    .HasColumnName("COption");

                entity.Property(e => e.Doption)
                    .HasMaxLength(200)
                    .HasColumnName("DOption");

                entity.Property(e => e.QuestSendPerson).HasColumnType("int(11)");

                entity.Property(e => e.Question).HasColumnType("text");

                entity.Property(e => e.QuestionDifficulty).HasColumnType("int(11)");

                entity.Property(e => e.QuestionParsing).HasMaxLength(200);

                entity.Property(e => e.QuestionResult).HasMaxLength(10);

                entity.Property(e => e.QuestionSubject).HasColumnType("int(11)");

                entity.Property(e => e.QuestionType).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Reply>(entity =>
            {
                entity.ToTable("reply");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.BoothAddress).HasColumnType("int(11)");

                entity.Property(e => e.ReplyPerson).HasColumnType("int(11)");

                entity.Property(e => e.ReplyReportInfo).HasColumnType("text");

                entity.Property(e => e.ReportTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Reportinfo>(entity =>
            {
                entity.ToTable("reportinfo");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Address).HasColumnType("int(11)");

                entity.Property(e => e.InfoPhoto).HasMaxLength(255);

                entity.Property(e => e.ReportInfo1)
                    .HasColumnType("text")
                    .HasColumnName("ReportInfo");

                entity.Property(e => e.ReportPerson).HasColumnType("int(11)");

                entity.Property(e => e.ReportState).HasColumnType("int(11)");

                entity.Property(e => e.ReportTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Role>(entity =>
            {
                entity.ToTable("roles");

                entity.HasIndex(e => e.Title, "Title")
                    .IsUnique();

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(20);
            });

            modelBuilder.Entity<Salary>(entity =>
            {
                entity.ToTable("salary");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.JobsId).HasColumnType("int(11)");

                entity.Property(e => e.Salary1)
                    .HasPrecision(10, 2)
                    .HasColumnName("Salary");
            });

            modelBuilder.Entity<SchoolIncome>(entity =>
            {
                entity.ToTable("school_income");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Income).HasMaxLength(255);

                entity.Property(e => e.IncomePrice).HasPrecision(10, 2);

                entity.Property(e => e.IncomeTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<Schoolspending>(entity =>
            {
                entity.ToTable("schoolspending");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.CheckState).HasColumnType("int(11)");

                entity.Property(e => e.Description).HasMaxLength(500);

                entity.Property(e => e.Price).HasPrecision(10, 2);

                entity.Property(e => e.Time)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Staffsalary>(entity =>
            {
                entity.ToTable("staffsalary");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.Salary).HasPrecision(10, 2);

                entity.Property(e => e.StaffId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Stuachievement>(entity =>
            {
                entity.ToTable("stuachievement");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.AchievementInfo).HasMaxLength(100);

                entity.Property(e => e.AchievementPerson).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Studentevaluate>(entity =>
            {
                entity.ToTable("studentevaluate");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.EvaluateInfo).HasMaxLength(100);

                entity.Property(e => e.EvaluateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.StudentId)
                    .HasColumnType("int(11)")
                    .HasColumnName("studentId");

                entity.Property(e => e.TeacherId)
                    .HasColumnType("int(11)")
                    .HasColumnName("teacherId");
            });

            modelBuilder.Entity<Studentexaminformation>(entity =>
            {
                entity.ToTable("studentexaminformation");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.ExamPaperInformation).HasColumnType("int(11)");

                entity.Property(e => e.ExamScore).HasColumnType("int(11)");

                entity.Property(e => e.ExamStudent).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Studentspermission>(entity =>
            {
                entity.ToTable("studentspermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.ClassId).HasColumnType("int(11)");

                entity.Property(e => e.StudentId).HasMaxLength(500);
            });

            modelBuilder.Entity<Studisciplinary>(entity =>
            {
                entity.ToTable("studisciplinary");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.DisciplinaryDescription).HasMaxLength(150);

                entity.Property(e => e.DisciplinaryPerson).HasColumnType("int(11)");

                entity.Property(e => e.DisciplinaryType).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Stuparentspermission>(entity =>
            {
                entity.ToTable("stuparentspermission");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.ParentsId)
                    .HasColumnType("int(11)")
                    .HasColumnName("parentsId");

                entity.Property(e => e.StudentId)
                    .HasColumnType("int(11)")
                    .HasColumnName("studentId");
            });

            modelBuilder.Entity<Subject>(entity =>
            {
                entity.ToTable("subject");

                entity.HasIndex(e => e.Title, "Title")
                    .IsUnique();

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.ParentId).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(20);
            });

            modelBuilder.Entity<Subjectpermission>(entity =>
            {
                entity.ToTable("subjectpermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.StaffId).HasColumnType("int(11)");

                entity.Property(e => e.SubjectId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Teachpermission>(entity =>
            {
                entity.ToTable("teachpermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.ClassId).HasColumnType("int(11)");

                entity.Property(e => e.StaffId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Tuition>(entity =>
            {
                entity.ToTable("tuition");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.TuitionPrice).HasPrecision(6, 2);
            });

            modelBuilder.Entity<Tuitionpermission>(entity =>
            {
                entity.ToTable("tuitionpermission");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Standard).HasColumnType("int(11)");

                entity.Property(e => e.TuitionRules).HasColumnType("int(11)");

                entity.Property(e => e.TuitionTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<User>(entity =>
            {
                entity.ToTable("users");

                entity.HasIndex(e => e.Account, "Account")
                    .IsUnique();

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Account).HasMaxLength(50);

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.Password).HasMaxLength(50);

                entity.Property(e => e.Rid).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Usersinfo>(entity =>
            {
                entity.ToTable("usersinfo");

                entity.HasIndex(e => e.Email, "Email")
                    .IsUnique();

                entity.HasIndex(e => e.IdentityCard, "IdentityCard")
                    .IsUnique();

                entity.HasIndex(e => e.Phone, "Phone")
                    .IsUnique();

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Address).HasMaxLength(50);

                entity.Property(e => e.Birthday).HasColumnType("datetime");

                entity.Property(e => e.Email).HasMaxLength(50);

                entity.Property(e => e.Gender).HasColumnType("int(11)");

                entity.Property(e => e.IdentityCard).HasMaxLength(50);

                entity.Property(e => e.Phone).HasMaxLength(50);

                entity.Property(e => e.RealName).HasMaxLength(10);

                entity.Property(e => e.UsersId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Warranty>(entity =>
            {
                entity.ToTable("warranty");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Address).HasColumnType("int(11)");

                entity.Property(e => e.Description).HasMaxLength(500);

                entity.Property(e => e.Person).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Warrantymoney>(entity =>
            {
                entity.ToTable("warrantymoney");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.WarrantyId).HasColumnType("int(11)");

                entity.Property(e => e.WarrantyMoney1)
                    .HasPrecision(7, 2)
                    .HasColumnName("WarrantyMoney");

                entity.Property(e => e.WarrantyState).HasColumnType("int(11)");

                entity.Property(e => e.WarrantyTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Webmenu>(entity =>
            {
                entity.ToTable("webmenu");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Link).HasMaxLength(255);

                entity.Property(e => e.ParentId).HasColumnType("int(11)");

                entity.Property(e => e.Title).HasMaxLength(50);
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
